intmain(){ int t = read(); while(t--){ int k = read(), len = read(); if (len >= 2000){ puts("-1"); continue; } ans.clear(); int m; // 特判 if (k % 2 == 0 && len == 1999){ m = 1996; int sum = (k + m) / 2 + 1; while(sum > 1000000){ ans.push_back(1000000); sum -= 1000000; } ans.push_back(sum); while(ans.size() < m) ans.push_back(0); cout << 1999 << "\n"; cout << "-1000000 1 -2 "; for (auto c : ans) cout << c << " "; cout << "\n"; continue; }
// 给m赋值 if (k & 1) m = 1997; else m = 1996; int sum = (k + m) / 2 + 1; while(sum > 1000000){ ans.push_back(1000000); sum -= 1000000; } ans.push_back(sum); while(ans.size() < m) ans.push_back(0); cout << m + 2 << "\n"; cout << "1 -2 "; for (auto c : ans) cout << c << " "; cout << "\n"; }